/**
 * \brief the data block in a file representing all package labels
 * 
 * The structure holds the very data related to the label in a
 * specific package. For example if a determined package holds the
 * labels:
 *  - public STUDENTS;
 *  - package ADMIN;
 *  - public PROFESSORS;
 *
 * this structure contains the data regarding the two *public* labels
 * STUDENTS and PROFESSORS;
 *
 * The data is stored as following figure:
 * \dot
 * 	digraph {
 * 		rankdir="LR";
 * 		memory [shape="record" height="2.5" label="n|heapend|hashtable|||||||values"];
 * 	}
 * \endot
 * 
 * where:
 * \li n represents the size of the hashtable;
 * \li heapend represents the last address in memory owned by the heap "values";
 * \li all the cell after hashtable (hashtable included) represents the hashtable itself.
 * 	The hashtable is of n cells;
 * \li all the cell after values (values) represents the values contained in the hashtable at
 * a particular index.
 *
 * In the LabelHeap the values are array of chars representing strings.
 * Let's make clearer the hashtable itself:
 * let's assume we need to store "hello" in the hashtable at the index 5.
 * To make this happen we write at the sixth position (the zero takes a position too)
 * after the "n" cell a integer. The integer indicates the difference between the real
 * position of the first char in the string "hello" in the "heap" values and the position
 * where values starts. In this way in hashtable there are just numbers while the true
 * values are store in the heap "values".
 *
 * \date Nov 15, 2013
 * \author koldar
 */

#ifndef LABELHEAP_H_
#define LABELHEAP_H_

#include <stdbool.h>

/**PlabelHeap is just a normal pointer which points
 * to a sector of the memory where resides an heap
 * representing all the label data.
 *
 */
typedef void* PlabelHeap;

//TODO docuemtation
/**@brief loads labeldata from a file into the memory
 *
 */
PlabelHeap loadLabelData(FILE* store);

//TODO docuemtation
bool findLabelData(Plabel labeltofind, PlabelHeap);

//TODO docuemtation
void printLabelData(FILE* f,PlabelHeap heap);

//TODO docuemtation
void freeLabelData(PlabelHeap heap);

#endif /* LABELHEAP_H_ */
